package com.hotel.couponsystem.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hotel.couponsystem.pojo.CouponStock;
import com.hotel.customersystem.pojo.CustomerUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * (CouponStock)表数据库访问层
 *
 * @author makejava
 * @since 2022-09-30 15:32:27
 */
@Mapper
public interface CouponStockMapper extends BaseMapper<CouponStock> {
    // 注销优惠券
    Integer deleteByCouponNo(@Param("couponNo") Integer couponNo);
    // 根据优惠券编号查询单条记录
    CouponStock selectByCouponNo(@Param("couponNo") Integer couponNo);
    // 根据使用方编号查询记录
    List<CouponStock> selectByCouponStatusNo(@Param("couponStatusNo") Integer couponStatusNo);
    // 秒杀优惠券，修改库存记录
    Integer reduceCouponStock(@Param("couponNo") String couponNo,@Param("version") Integer version);

    CouponStock getByCouponNo(@Param("couponNo") String couponNo);

}

